package restoreString;

public class Slution {
    public String restoreString(String s, int[] indices) {
        char[]ans = new char[s.length()];
        for (int i = 0; i < indices.length; i++) {
            ans[indices[i]] = s.charAt(i);
        }
        StringBuilder sb = new StringBuilder();
        for (char c: ans) {
            sb.append(c);
        }
        return sb.toString();
    }
}
